package com.zhouqinuan.spring.cloud.develop.framework.demo.apollo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSON;
import com.zhouqinuan.spring.cloud.develop.framework.demo.apollo.service.ApolloService;
import com.zhouqinuan.spring.cloud.develop.framework.demo.apollo.service.UserService;

import io.swagger.annotations.Api;

@Api(tags = "apollo测试例子")
@RestController
public class ApolloController {

    @Autowired
    private UserService userService;

    @Autowired
    private ApolloService apolloService;

    @GetMapping(path = "/get/user")
    public String getUser() {

        return JSON.toJSONString(userService.getUserInfo(apolloService.getUserinfoUid()));
    }
}
